<?php


namespace app\store\model;

use app\common\model\WxappMenu as WxappMenuModel;

class WxappMenu extends WxappMenuModel
{

    public static function getList()
    {
        return self::with('icon')->order('sort asc')->select();
    }

    public function add(array $data)
    {
        $data['wxapp_id'] = static::$wxapp_id;
        return $this->allowField(true)->save($data);
    }

    public static function getMenuById($id)
    {
        return self::with('icon')->find($id);
    }

    public function edit(array $data)
    {
        return $this->allowField(true)->save($data);
    }
}